<html>
<head>
<title>Content Management System - Met CS 633 Distributed Software Development Class</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link href="css/cms.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="820px" align="center">
	<tr>
		<td><img src="images/top.jpg" width="820px" height="20px" alt="CMS"></td>
	</tr>
	<tr>
		<td>
			<table cellpadding="2" cellspacing="1" width="90%" class="box_gray" align="center">
				<TR>
					<TD background="images/menu.bg.jpg" class="cmstitle" align="center">MET CS 633 Distributed Software Development - Content Management System</TD>
				</TR>
				<tr>
					<td class="contentheader1">Food List</td>
				</tr>
				<form method="POST" action="cms_food_search.php" name="foodsearch">
					<input type="hidden" name="foodname" value="<?=$search_str?>">
				<? if (!empty($food_array)) { ?>
				<tr>
					<td>
						<table cellpadding="2" cellspacing="2">
							<tr bgcolor="#436183" "#000066" "CCCDEB" class="cmstable">
								<td>Action</td>
								<td><img src="images/spacer.gif" width="1px"></td>
								<td>Food Name</td>
							</tr>
							<?
							$bgColor = "#FFFFFF";
							foreach ($food_array as $food) {
								if ($bgColor == "#FFFFFF") {
									$bgColor = "#E8E8EB";
								}
								else {
									$bgColor = "#FFFFFF";
								}?>
							<tr bgcolor="<?=$bgColor?>" class="content">
									<td><a href="cms_edit_food.php?food_id=<?=$food["food_id"]?>" class="content">EDIT</a> | <a href="cms_delete_food.php?food_id=<?=$food["food_id"]?>" class="content">DELETE</a> | <a href="cms_view_food.php?food_id=<?=$food["food_id"]?>" class="content">VIEW</a></td>
									<td><img src="images/spacer.gif" width="3px"></td>
									<td><?=$food["food_name"]?></td>
							</tr>
							<?}?>
						</table>
					</td>
				</tr>
				<? }
				else { ?>
				<tr>
					<td>
						<table cellpadding="2" cellspacing="2">
							<tr>
								<td class="content"><i>Sorry, your search did not render any results. Please try to expand upon your search criteria.</i></td>
							</tr>
							<tr>
								<td><input type="text" class="shadeform" value="<?=$foodsearch["foodname"]?>" name="foodname"><img src="images/spacer.gif" width="10"><input type="submit" value="Search" name="submit" onmouseover="this.className='submitbuttonon'" onmouseout="this.className='submitbutton'" class="submitbutton"></td>
							</tr>
						</table>
					<td>
				<tr>
				<? } ?>
				</form>
				<tr>
					<td class="content"><img src="images/spacer.gif" height="10"><a href="cms_add_food.php" class="content">Add Food</td>
				</tr>
				<tr>
					<td><img src="images/paragraph-line.gif" width="720px"></td>
				</tr>
				<tr>
					<td class="content"><img src="images/spacer.gif" height="10"></td>
				</tr>
				<tr>
					<td class="content"><img src="images/spacer.gif" height="10"><a href="cms_main.php" class="content"> Return to CMS Main</a> | <a href="main.php" class="content"> Exit CMS</a></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td><img src="images/spacer.gif" width=29 height=10 alt=""></td>
	</tr>
</table>
</body>
</html>